﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:AccountHelper"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:converters="clr-namespace:AccountHelper.Converters"
    xmlns:cmd="clr-namespace:MvvmLight.Command;assembly=MvvmLight"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d">

    <!--Convertes-->
    <converters:BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" />
    <converters:StringToVisibilityConverter x:Key="stringToVisibilityConverter" />
    <converters:NumberToChsConverter x:Key="numberToChsConverter" />

    <!--NewChargeView TextBlock-->
    <Style x:Key="S_NewCharge" TargetType="TextBlock">
        <Setter Property="FontSize" Value="24" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Margin" Value="20,0" />
    </Style>
    
    <DataTemplate x:Key="DT_Charges_List">
        <Grid Height="100" Background="Transparent">
            <toolkit:ContextMenuService.ContextMenu>
                <toolkit:ContextMenu IsZoomEnabled="False" Background="White">
                    <toolkit:MenuItem Command="{Binding MainVM.EditCommand,Source={StaticResource Locator}}" CommandParameter="{Binding}">
                        <toolkit:MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Image Source="Images/Appbar/appbar.edit.rest.png" />
                                <TextBlock Text="编辑" Foreground="Black"/>
                            </StackPanel>
                        </toolkit:MenuItem.Header>
                    </toolkit:MenuItem>
                    <toolkit:MenuItem Command="{Binding MainVM.CopyCommand,Source={StaticResource Locator}}" CommandParameter="{Binding}">
                        <toolkit:MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Image Source="Images/Appbar/appbar.save.rest.png" />
                                <TextBlock Text="复制" Foreground="Black"/>
                            </StackPanel>
                        </toolkit:MenuItem.Header>
                    </toolkit:MenuItem>
                    <toolkit:MenuItem Command="{Binding MainVM.DeleteCommand,Source={StaticResource Locator}}" CommandParameter="{Binding}">
                        <toolkit:MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Image Source="Images/Appbar/appbar.delete.rest.png" />
                                <TextBlock Text="删除" Foreground="Black"/>
                            </StackPanel>
                        </toolkit:MenuItem.Header>
                    </toolkit:MenuItem>
                </toolkit:ContextMenu>
            </toolkit:ContextMenuService.ContextMenu>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="0.757*"/>
                    <RowDefinition Height="0.243*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.8*" />
                    <ColumnDefinition Width="0.2*" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Foreground="White" Text="{Binding ChargeTitle}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="32" />
                <TextBlock Grid.Row="1" Foreground="White" Text="{Binding ChargeDate}" HorizontalAlignment="Left" FontSize="18"/>
                <TextBlock Grid.Column="1" Foreground="White" FontWeight="Bold" Grid.ColumnSpan="2" Text="{Binding Amount}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="40" />
            </Grid>
        </Grid>
    </DataTemplate>
</ResourceDictionary>